//引入axios实例
import http from "@/util/request";

export function buildTreeMenu(val) {
    return http({
        method: "GET",
        url: "/menu/buildTreeMenu",
        params: val
    })
}

export function getAllMenu() {
    return http({
        method: "GET",
        url: "/menu/getAllMenu",
    })
}

export function getMenu(val) {
    return http({
        method: "GET",
        url: "/menu/getMenu",
        params: val
    })
}

export function getMenuId(val) {
    return http({
        method: "GET",
        url: "/menu/getMenuId",
        params: val
    })
}

export function addMenu(val) {
    return http({
        method: "POST",
        url: "/menu/add",
        data: val
    })
}

export function updateMenu(val) {
    return http({
        method: "POST",
        url: "/menu/update",
        data: val
    })
}

export function getMenuByIdQuery(roleId) {
    return http({
        method: "get",
        url: "/menu/getMenuById",
        params: { roleId }
    })
}

export function getAllRoleQuery() {
    return http({
        method: "get",
        url: "/menu/getAllRole"
    })
}

export function changePerMenuQuery(data) {
    return http({
        method: "post",
        url: "/menu/changePerMenu",
        data: data
    })
}